﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateSelect.aspx.cs" Inherits="CampanyCMS.WebUI.Admin.SystemManager.TemplateSelect" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>PassWordManager</title>
		<script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
		<LINK href="../../css/cssCn1.css" type="text/css" rel="stylesheet">
		<LINK href="../../css/cssCn.css" type="text/css" rel="stylesheet">
		<script type="text/javascript">
     function setRadio(nowRadio) {
         var myForm, objRadio;
         myForm = document.getElementsByTagName("input");
         for (var i = 0; i < myForm.length; i++) {
             objRadio = myForm[i];
             if (objRadio.type == "radio") {
                 if (objRadio.id != nowRadio.id
                                    && objRadio.id.indexOf("rpTemplate") != -1
                                    && objRadio.id.indexOf("selTemplate") != -1) {

                     if (objRadio.checked) {
                         objRadio.checked = false;
                     }
                 }
             }
         }
     }

     function check() {

         if ($('#txtHtmlCreateFolder').val() == '') {
             alert("静态页面生成 目录不能为空！");
             $('#txtHtmlCreateFolder').focus();
             return false;
         }
         if ($('#txtDefaultHomePage').val() == '') {
             alert("首页地址不能为空！");
             $('#txtDefaultHomePage').focus();
             return false;
         }
         var myForm = document.getElementsByTagName("input");
         var flagSelected = false;
         for (var i = 0; i < myForm.length; i++) {
             var objRadio = myForm[i];
             if (objRadio.id.indexOf("rpTemplate") != -1
                                    && objRadio.id.indexOf("selTemplate") != -1) {
                 if (objRadio.checked) {
                     flagSelected = true;
                 }
             }
         }
         if (!flagSelected) {
             alert("请选择模板！");
             return false;
         }
         return true;

     }
        </script>
        
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td>
						<div class="div_subtitle">当前位置：系统管理<span class="arrow_subtitle">&gt;<FONT face="Verdana">模板选择</FONT></span></div>
					</td>
				</tr>
			</table>
			<table align="center" cellPadding="0" cellSpacing="0" id="tb_content">
				<TBODY>
					<tr>
						<td>
							<TABLE class="tb_searchbar" cellSpacing="1" width="100%">
								<TBODY>
									<TR>
										<TD colspan="4" noWrap ><img src="../../img/icon_note.gif" width="18" height="18" class="icon">模板列表</TD>
									</TR>									 
								</TBODY>
							</TABLE>
							<TABLE cellSpacing="0"  class="tb_input" cellpadding="1" width="100%">
									 <tr>
                                        <td class="td_title" width="15%">
                                            HTML生成目录
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtHtmlCreateFolder" Width="350px" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
									 <tr>
                                        <td class="td_title" width="15%">
                                            首页地址
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDefaultHomePage" Width="350px" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
									 <tr>
                                        <td class="td_title" width="15%">
                                            模板选择
                                        </td>
                                        <td>
                                             <asp:HiddenField ID="txtOldTemplateID" runat="server" />
                                              <table class="tb_datalist" cellspacing="0" rules="all" 
                                                border="1" id="dgNews" style="border-style:Solid;width:100%;border-collapse:collapse;margin-top: 5px">
	                                            <tr class="tr_title">

                                                    <td style=" width:50px">选择</td>
                                                    <td style=" width:150px">模板名</td>
                                                    <td>预览</td>                                                    
                                                </tr>                                                
                                                <asp:repeater id="rpTemplate" runat="server" onitemdatabound="rpTemplate_ItemDataBound">                
                                                    <ItemTemplate>                                                      
                                                             <tr class=tr_alertrow">
                                                                <td >                                                            
                                                                  <asp:RadioButton runat="server" id="selTemplate" ></asp:RadioButton><asp:HiddenField Value='<%# DataBinder.Eval(Container.DataItem, "Template_ID") %>'
                                                                      ID="txtTemplateID" runat="server" />
                                                                      <asp:HiddenField Value='<%# DataBinder.Eval(Container.DataItem, "Template_Floder") %>'
                                                                      ID="txtTemplatePath" runat="server" />
                                                                </td>
                                                                <td><strong><asp:Literal runat="server" id="lblTemplateName" Text='<%# DataBinder.Eval(Container.DataItem, "Template_Name") %>'></asp:Literal></strong></td>
                                             
                                                                <td >
                                                                    <asp:Image ID="Image1" Width="200" runat="server" />
                                                                </td>
                                                                </tr>   
                                                    </ItemTemplate>
                                                </asp:repeater>
                                             
                                             </table>
                                        </td>
                                    </tr>          
									</td>
								</tr>
							</TABLE>
							<div align="right">
								<asp:Button id="btnSave" runat="server" Text="保存" CssClass="button" onclick="btnSave_Click"></asp:Button>&nbsp;
							</div>
							  
						</td>
					</tr>
				</TBODY>
			</table>
		</form>
	</body>
</HTML>
